﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DownloadTS
{
    class TSHeader
    {
        /// <summary>
        /// 同步字节，固定为0x47
        /// length:8b
        /// </summary>
        public byte sync_byte;
        /// <summary>
        /// 传输错误指示符，表明在ts头的adapt域后由一个无用字节，通常都为0，这个字节算在adapt域长度内
        /// length:1b
        /// </summary>
        public byte transport_error_indicator;
        /// <summary>
        /// 负载单元起始标示符，一个完整的数据包开始时标记为1
        /// length:1b
        /// </summary>
        public byte payload_unit_start_indicator;
        /// <summary>
        /// 传输优先级，0为低优先级，1为高优先级，通常取0
        /// length:1b
        /// </summary>
        public byte transport_priority;
        /// <summary>
        /// pid值
        /// length:13b
        /// </summary>
        public short pid;
        /// <summary>
        /// 传输加扰控制，00表示未加密
        /// length:2b
        /// </summary>
        public byte transport_scrambling_control;
        /// <summary>
        /// 是否包含自适应区，‘00’保留；‘01’为无自适应域，
        /// 仅含有效负载；‘10’为仅含自适应域，
        /// 无有效负载；‘11’为同时带有自适应域和有效负载
        /// length:2b
        /// </summary>
        public byte adaptation_field_control;
        /// <summary>
        /// 递增计数器，从0-f，起始值不一定取0，但必须是连续的
        /// length:4b
        /// </summary>
        public byte continuity_counter;

        public TSHeader(byte[] headers)
        {

        }
    }
}
